﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace EFong.Contract
{
    [DataContract]
    public class PTrainOrderDetail
    {
        private DateTime? _departDate;
        [DataMember]
        public DateTime? DepartDate
        {
            get { return _departDate; }
            set { _departDate = value; }
        }

        private string _日期 = null;
        public string 日期
        {
            get
            {
                if (_日期 == null)
                    if (this.DepartDate == null)
                        return string.Empty;
                    else
                        return this.DepartDate.Value.ToString("yyyy/MM/dd");
                else
                    return _日期;
            }
            set
            {
                _日期 = value;
            }
        }

        public string 时间
        {
            get
            {
                if (_日期 == null)
                    if (this.DepartDate == null)
                        return string.Empty;
                    else
                        return this.DepartDate.Value.ToString("HH:mm");
                else
                    return _日期;
            }
        }

        private string _departLocation = string.Empty;
        [DataMember]
        public string DepartLocation
        {
            get { return _departLocation; }
            set { _departLocation = value; }
        }

        private string _destination = string.Empty;
        [DataMember]
        public string Destination
        {
            get { return _destination; }
            set { _destination = value; }
        }

        private string _seatType = string.Empty;
        [DataMember]
        public string SeatType
        {
            get { return _seatType; }
            set { _seatType = value; }
        }

        private string _trainNo = string.Empty;
        [DataMember]
        public string TrainNo
        {
            get { return _trainNo; }
            set { _trainNo = value; }
        }

        public string 行程
        {
            get
            {
                return string.Format("{0} 至 {1}", this.DepartLocation, this.Destination);
            }
        }

        private decimal _ticketPrice;
        [DataMember]
        public decimal TicketPrice
        {
            get { return _ticketPrice; }
            set { _ticketPrice = value; }
        }

        private int _qty;
        [DataMember]
        public int Qty
        {
            get { return _qty; }
            set { _qty = value; }
        }

        private decimal? _deliveryCost;
        [DataMember]
        public decimal? DeliveryCost
        {
            get { return _deliveryCost; }
            set { _deliveryCost = value; }
        }

        private decimal _totalPrice;
        [DataMember]
        public decimal TotalPrice
        {
            get { return _totalPrice; }
            set { _totalPrice = value; }
        }
    }
}
